package io.xccit.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author CH_ywx
 * @date 2023-06-05
 * @description
 */
@Controller
public class IndexController {

    @GetMapping("/index")
    @PreAuthorize("hasAnyRole('ROLE_admin')")
    @ResponseBody
    public String index(){
        return "Index";
    }

    @GetMapping("/hello")
    @ResponseBody
    public String hello(){
        return "Hello SpringSecurity";
    }
}
